﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExtAspNet;

namespace HY.WEB.SA
{
    public partial class comp_view :  PageBase
    {
        public string us, whe = "", path = "";           
        protected void Page_Load(object sender, EventArgs e)
        {
            us = Session["ID"].ToString();
            if (!IsPostBack)
            {
                if (!String.IsNullOrEmpty(Request["sid"]))
                {
                     hidsid.Text = Request["sid"].Trim();                
                }

                if (!String.IsNullOrEmpty(Request["cbh"]))
                {
                    hidsid.Text = Request["cbh"].Trim();
                   hidsid.Text =BLL.Bllbase.get_val("company", "sid", "cbh='" + hidsid.Text + "'");
                }

                fill2();
            }

        
        }

        

        void fill2()
        {


            BLL.CO.company S = new BLL.CO.company();

          DataTable d=  S.GetList("sid="+hidsid.Text).Tables[0];


          hidsbh.Text = d.Rows[0]["cbh"].ToString().Trim();
          lblbh.Text = hidsbh.Text;

          lblnm.Text = d.Rows[0]["cname"].ToString().Trim();
          lbldate.Text = d.Rows[0]["reg_date"].ToString().Trim();
          lblxz.Text = d.Rows[0]["cntype"].ToString().Trim();

          lbladdress.Text = d.Rows[0]["addresss"].ToString();

          lblpost.Text = d.Rows[0]["post"].ToString().Trim();

          lblcity.Text = BLL.Bllbase.get_val("pub_area","svalue","scode='"+d.Rows[0]["city"].ToString()+"'");

          lblperson.Text = d.Rows[0]["person"].ToString().Trim();

          lbltel.Text = d.Rows[0]["ctel"].ToString();

          lblfax.Text = d.Rows[0]["cfax"].ToString();

          lblwebsite.Text = d.Rows[0]["website"].ToString().Trim();

          lblmail.Text = d.Rows[0]["email"].ToString().Trim();
          lblmtel.Text = d.Rows[0]["mtel"].ToString().Trim();


          lblnum.Text = d.Rows[0]["cnum"].ToString().Trim();

          lblht.Text = d.Rows[0]["ht"].ToString().Trim();
            
          lbltype.Text = d.Rows[0]["salestype"].ToString().Trim();

  
           lblstatus.Text = d.Rows[0]["cstatus"].ToString().Trim();

          lblhy.Text = d.Rows[0]["hytype"].ToString().Trim();
          lblmemo.Text =BLL.BllHtml.LostHTML(Server.HtmlDecode(d.Rows[0]["memo"].ToString().Trim()));
         
            }   
       
       
    }
}